#include <iostream>

using namespace std;

typedef long long LL;

LL n, k;
int cnt;

int main()
{
	cin >> n >> k;
	
	while (n)
	{
		if (n % 10 == 3) cnt ++ ;
		
		n /= 10;
	}
	
	if (cnt == k) puts("YES");
	else puts("NO");
	
	return 0;
}
